{template header_admin}
<div id="pagecontainer">
  <div class="toolbar">
      <div class="f-right">
          <form method="get" name="search" action="/?">
          <input type="hidden" name="m" value="$G[m]" />
          <input type="hidden" name="c" value="$G[c]" />
          <input type="hidden" name="q" value="$G[q]" />
          <select name="field">
              <option value="uid"{if $field=='uid'} selected{/if}>UID</option>
              <option value="username"{if $field=='username'} selected{/if}>姓名</option>
              <option value="mobile"{if $field=='mobile'} selected{/if}>手机号</option>
              <option value="email"{if $field=='email'} selected{/if}>邮箱</option>
          </select>
          <input type="text" class="text text200" name="keyword" value="$keyword" />
          <input type="submit" class="button search" value="搜索" />
          </form>
      </div>
      <strong>会员列表</strong>
      <a href="/?m=$G[m]&c=$G[c]&a=create" class="baritem">添加用户</a>
  </div>
  <div class="table-hd">
  <form method="post" action="">
      <input type="hidden" name="formsubmit" value="yes">
      <input type="hidden" name="formhash" value="{FORMHASH}" />
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="listtable">
      <thead>
      <tr>
        <th width="20"><input type="checkbox" class="checkbox" name="uid[]" value="0" onclick="DSXCMS.checkAll(this,'uid[]')" /></th>
        <th width="100">姓名</th>
        <th width="100">手机号</th>
        <th>电子邮箱</th>
        <th width="80">用户组</th>
        <th width="140">注册日期</th>
        <th width="140">最后登录</th>
        <th width="100">最后登录IP</th>
        <th width="70">状态</th>
        <th width="40">编辑</th>
      </tr>
      </thead>
      <tbody id="members">
      {loop $memberlist $uid $member}
      {eval $isfounder=in_array($uid, C('FOUNDERS'));}
      {eval $member[regdate]=@date('Y-m-d H:i',$memberstatus[$member[uid]][regdate]);}
      {eval $member[lastvisit]=@date('Y-m-d H:i',$memberstatus[$member[uid]][lastvisit]);}
      <tr>
        <td><input type="checkbox" class="checkbox"{if !$isfounder} name="uid[]" value="{$member[uid]}"{else} disabled="disabled"{/if} /></td>
        <th><a href="/?m=space&uid=$member[uid]" target="_blank">$member[username]</a></th>
        <td>$member[mobile]</td>
        <td>$member[email]</td>
        <td>{$usergrouplist[$member[gid]][title]}</td>
        <td>$member[regdate]</td>
        <td>$member[lastvisit]</td>
        <td><a href="http://www.ip138.com/ips.asp?ip={$memberstatus[$member[uid]][lastvisitip]}" target="_blank">	{$memberstatus[$member[uid]][lastvisitip]}</a></td>
        <td>$lang[memberstatus][$member[status]]</td>
       	<td><a href="/?m=$G[m]&c=$G[c]&a=edit&uid=$member[uid]">编辑</a></td>
      </tr>
      {/loop}
      </tbody>
      <tfoot>
      <tr>
          <td colspan="12">
              <label><input type="checkbox" class="checkbox" onclick="DSXCMS.checkAll(this,'uid[]')" /> 全选</label>
              <label><input type="radio" name="option" value="delete" checked> 删除</label>
              <label><input type="radio" name="option" value="normal"> 正常</label>
              <label><input type="radio" name="option" value="nologin"> 禁止登录</label>
              <label><input type="radio" name="option" value="nopost"> 禁止发言</label>
          </td>
      </tr>
      <tr>
          <td colspan="12">
              <span class="pages">{$pages}</span>
              <input type="submit" class="submit" value="提交" />
              <input type="button" class="button" value="刷新" onclick="window.location.reload()" />
          </td>
      </tr>
      </tfoot>
    </table>
   </form>
   </div>
</div>
<script type="text/javascript">
$("#formuser").submit(function(){
	if($(this).find("input[name=optype]:checked").val() == 1){
		return confirm("您确定要删除所选用户吗？\n用户删除后将无法恢复");
	}else{
		return true;
	}
});
</script>
{template footer_admin}